package sng.modules.controller
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import sng.modules.model.HudProxy;
	import sng.modules.model.vo.HudVO;
	import sng.modules.system.NameSpace;
	import sng.modules.system.SocialSystem;
	import sng.modules.view.HudMediator;
	
	/**
	 * 
	 * @author leonliu
	 * 
	 */	
	public class HudCommand extends SimpleCommand
	{
		public function HudCommand()
		{
		}
		
		override public function execute(notification:INotification):void
		{
			
			
			switch (notification.getName())
			{
				case NameSpace.HudInitUI://初始化UI
				{
					var hudproxy:HudProxy=new HudProxy();
					facade.registerProxy(hudproxy);
					
					var __hudProxy:HudProxy = facade.retrieveProxy(NameSpace.HudProxyName) as HudProxy;

					var app:Main=notification.getBody() as Main;
					facade.registerMediator(new HudMediator(app));
					
					break;
				}
				case NameSpace.HudInitData://初始化用户数据
				{
					var hudVO:HudVO = notification.getBody() as HudVO;

					//从facade中获取proxy
					var hudProxy:HudProxy = facade.retrieveProxy(NameSpace.HudProxyName) as HudProxy;
					hudProxy.InitGameData(hudVO);
					break;
				}
				case SocialSystem.SocialFriendsCityEntryRequest://初始化好友用户数据
				{
					var uid:uint = notification.getBody() as uint;//好友QQ号
					
					//从facade中获取proxy
					var _hudProxy:HudProxy = facade.retrieveProxy(NameSpace.HudProxyName) as HudProxy;
					_hudProxy.initFriendData(uid);
					break;
				}
			
					
				default:
					break;
			}
		}
			
			
	}
}